using System;

namespace Nyanimals
{
    /// <summary>
    /// CNyanFruit - Helps cure hunger
    /// </summary>
    public class CNyanBerry : CBaseFood
    {
        public CNyanBerry() : base()
        {
            biteCount = 5;
        }        
        public override bool Bite (CNyanimal nyan)
        {            
            // try biting
            bool canBite = base.Bite(nyan);
            bool atStatEdge = false;
            if(canBite)
            {
                // decrease the ammount of hunger
                float gain = CalculateStatGain();
                nyan.Hunger += gain;
                
                // if we are full, then we can leave
                if(nyan.HungerStatus != 0)
                {
                    atStatEdge = true;
                }
            }
            
            return canBite && (!atStatEdge);
        }
        public override FoodTypes FoodType
        {
            get { return FoodTypes.NyanBerry_Food;}
        }
    }
}

